﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartSpace.Core
{
    public class PrivilegeOwnerType
    {
        public string Code { get; set; }
        public string Caption { get; set; }

        private PrivilegeOwnerType(string code, string caption)
        {
            Code = code;
            Caption = caption;
        }

        public static readonly PrivilegeOwnerType Role = new PrivilegeOwnerType("ROLE", "角色");
        public static readonly PrivilegeOwnerType UserGroup = new PrivilegeOwnerType("USERGROUP", "用户组");

        public static bool operator ==(PrivilegeOwnerType a1, PrivilegeOwnerType a2)
        {
            if (a1.Code == a2.Code)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public static bool operator !=(PrivilegeOwnerType a1, PrivilegeOwnerType a2)
        {
            return !(a1 == a2);
        }
    }
}
